import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 班级信息信息 */
export interface SysClass {
          classId: number; // 班级ID
          majorId?: number; // 所属专业ID
          enrollmentTermId?: number; // 入学学期ID
          className?: string; // 班级名称
          classCode?: string; // 班级编码
          grade?: string; // 年级
          headteacherId: number; // 班主任ID
          counselorId: number; // 辅导员ID
          studentCount: number; // 学生人数
          status?: number; // 状态（0在线 1离线 2空闲）
  }

// 班级信息 API
export const SysClassApi = {
  // 查询班级信息分页
  getSysClassPage: async (params: any) => {
    return await request.get({ url: `/ao/sys-class/page`, params })
  },

  // 查询班级信息详情
  getSysClass: async (id: number) => {
    return await request.get({ url: `/ao/sys-class/get?id=` + id })
  },

  // 新增班级信息
  createSysClass: async (data: SysClass) => {
    return await request.post({ url: `/ao/sys-class/create`, data })
  },

  // 修改班级信息
  updateSysClass: async (data: SysClass) => {
    return await request.put({ url: `/ao/sys-class/update`, data })
  },

  // 删除班级信息
  deleteSysClass: async (id: number) => {
    return await request.delete({ url: `/ao/sys-class/delete?id=` + id })
  },

  /** 批量删除班级信息 */
  deleteSysClassList: async (ids: number[]) => {
    return await request.delete({ url: `/ao/sys-class/delete-list?ids=${ids.join(',')}` })
  },

  // 导出班级信息 Excel
  exportSysClass: async (params) => {
    return await request.download({ url: `/ao/sys-class/export-excel`, params })
  },
}
